# Contributor: Michał Szmidt <michal.sz@disroot.org>
# Maintainer: Michał Szmidt <michal.sz@disroot.org>
pkgname=hctl
pkgver=0.2.6
pkgrel=0
pkgdesc="Ultimate tool to manage (transform, merge, validate) hostlists written in rust for pihole/adguard/unbound dns blocker"
url="https://github.com/michalszmidt/hctl"
arch="all"
license="BSD-3-Clause"
makedepends="openssl-dev cargo cargo-auditable"
source="$pkgname-$pkgver.tar.gz::https://github.com/michalszmidt/hctl/archive/refs/tags/$pkgver.tar.gz"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build -p hctl --frozen --release
}

check() {
	cargo test --release --frozen
}

package() {
	install -Dm755 target/release/hctl -t "$pkgdir"/usr/bin/
}

sha512sums="
e90273a3f5d386993a611135e8962838894be428600b149b138e2c3604bf669fa7ec04ad98b9a644e903880e626ede0a596b185025dc6abf4018f5effeee2d4c  hctl-0.2.6.tar.gz
"
